#include <iostream>

using namespace std;

template <typename IterT, typename DistT>
void doAdvance(IterT &iter, DistT d, std::random_access_iterator_tag)
{}

template <typename IterT, typename DistT>
void advance(IterT &iter, DistT d)
{
    doAdvance(iter, d, 
            typename std::iterator_traits<IterT>::iterator_catetgory());
}

template <typename IterT>
struct iterator_traits
{
    typedef typename IterT::iterator_category iterator_category;
};
